home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11768 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.0 KB  |  44 lines

  1. Path: newsfeed.concentric.net!news-master!not-for-mail
  2. From: SCLARK74@CRIS.COM (Steve Clark)
  3. Newsgroups: comp.lang.c
  4. Subject: Help with the spawnlp function in TC++ 3.0
  5. Date: 25 Mar 1996 17:06:06 -0500
  6. Organization: Concentric Internet Services
  7. Sender: Sclark74@voyager.cris.com
  8. Message-ID: <UokVxUJdkXxX088yn@CRIS.COM>
  9. NNTP-Posting-Host: voyager-fddi.cris.com
  10.  
  11. Hello,
  12.  
  13. I can't figure out why the following code will not work.  What I'm
  14. trying to do is execute TCC from with in my C program and pass it the
  15. file TEST.C on the command-line.  I can get TCC to execute perfectly but
  16. no matter what I do, it always ignores the command-line argument.  Here's
  17. the code.
  18.  
  19.  
  20. ---------------
  21. #include <process.h>
  22. #include <stdio.h>
  23. #include <conio.h>
  24.  
  25. void main(void)
  26. {
  27.    int result;
  28.  
  29.    result = spawnlp(P_WAIT, "TCC", "TEST.C", NULL);
  30.    if (result == -1)
  31.    {
  32.       perror("Error:");
  33.       exit(1);
  34.    }
  35. }
  36.  
  37. ---------------
  38.  
  39. What am I doing wrong here?  Thanks for any help!
  40.  
  41. Steve Clark
  42. CompuServe: 75027,3554
  43. Internet:   sclark74@cris.com
  44.